/*
 * @(#)NewBody.java 0.0.1-SNAPSHOT
 * Copyright Group B
 */

package grupb.upf.XMLObjects.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Vector;

/**
 * <p>This class implements the NewBody interface.  It contains the methods to
 * manage the paragraphs and photos of a new.</p>
 *
 * @version    0.0.1-SNAPSHOT
 * @author     Group B
 */
public final class NewBody implements grupb.upf.XMLObjects.NewBody,
        Serializable {

    /**
     * The serialVersionUID is created to be able to serialize this class, it's
     * necessary because it will be sent.
     */
    private static final long serialVersionUID = 1L;
    /**
     * A list that contains the body of the new containing paragraphs
     * and pictures.
     */
    private List < Object > elements = new Vector < Object > ();
    /**
     * This method allows us to add a photo or a paragraph.
     * @param object A photo or a paragraph
     */
    @Override
    public void addElement(final Object object) {
        this.elements.add(object);
    }
    /**
     * This return an element (photo/paragraph) in an specefic posistion.
     * @param position The location of the object
     * @return The object
     */
    @Override
    public Object getElementAt(final int position) {
        return this.elements.get(position);
    }
    /**
     * Returns the paragraphs and photo of the new.
     * @return The paragraph and photos of the new
     */
    @Override
    public List getElements() {
        return this.elements;
    }
}
